<template>
  <div class="g-inline">
    <el-input
      placeholder="请输入会议密码"
      type="password"
      :show-password="true"
      v-model="meetingPassword"
      clearable
    ></el-input>
    <el-button type="primary" @click="handleSingleJoinMeeting">确定</el-button>
  </div>
</template>

<script>
export default {
  name: 'PasswordForm',
  props: {
    meetingId: {
      type: String,
      required: true
    }
  },
  data () {
    return {
      meetingPassword: ''
    }
  },
  methods: {
    handleSingleJoinMeeting () {
      this.$request.conference.singleJoinMeeting(
        this.meetingId,
        this.meetingPassword,
        res => {
          this.$emit('join')
        },
        err => {
          this.$message.error(err.msg)
        }
      )
    }
  }
}
</script>

<style scoped>
</style>
